package com.youju.community.service.impl;

import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
import com.jiazhong.youju.commons.bean.Community;
import com.jiazhong.youju.commons.utils.JSONResult;
import com.youju.community.mapper.CommunityMapper;
import com.youju.community.service.CommunityService;
import org.springframework.stereotype.Service;

@Service
public class CommunityServiceImpl extends ServiceImpl<CommunityMapper, Community>
        implements CommunityService {
    @Override
    public JSONResult findNameById(int id) {
        QueryWrapper<Community> wrapper =new QueryWrapper<>();
        wrapper.select("name");
        wrapper.eq("id",id);
        Community community = getOne(wrapper);
        return new JSONResult<>(true,null,200,community.getName());
    }
}
